package com.boil.pojo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ChenYong on 2016-10-11.
 * <br>
 * DataTables 专用分页映射实体类。 <br>
 * 严格按照 DataTables 的要求返回固定格式的 JSON。
 */
public class Page2Vo<T> {
    /**
     * 来自客户端 sEcho 的没有变化的复制品
     */
    private Long sEcho;
    /**
     * 实际的行数
     */
    private Long iTotalRecords;
    /**
     * 过滤之后，实际的行数
     */
    private Long iTotalDisplayRecords;
    /**
     * 数据
     */
    private List<T> aaData;

    // 普通初始化块
    {
        aaData = new ArrayList<T>();
    }

    /**
     * 默认构造器。
     */
    public Page2Vo() {
        super();
    }

    public Long getsEcho() {
        return sEcho;
    }

    public void setsEcho(Long sEcho) {
        this.sEcho = sEcho;
    }

    public Long getiTotalRecords() {
        return iTotalRecords;
    }

    public void setiTotalRecords(Long iTotalRecords) {
        this.iTotalRecords = iTotalRecords;
    }

    public Long getiTotalDisplayRecords() {
        return iTotalDisplayRecords;
    }

    public void setiTotalDisplayRecords(Long iTotalDisplayRecords) {
        this.iTotalDisplayRecords = iTotalDisplayRecords;
    }

    public List<T> getAaData() {
        return aaData;
    }

    public void setAaData(List<T> aaData) {
        this.aaData = aaData;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Page2Vo{");
        sb.append("sEcho=").append(sEcho);
        sb.append(", iTotalRecords=").append(iTotalRecords);
        sb.append(", iTotalDisplayRecords=").append(iTotalDisplayRecords);
        sb.append(", aaData=").append(aaData);
        sb.append('}');
        return sb.toString();
    }
}